<?php 
	
	include("pagina_restrita.php"); 
		
	$id =(int)$_GET['id'];
	
	// abre conexão com banco de dados
	require("funcoesBD.php");
	conectarBancoDados();
				
	if(mysql_query("SELECT id_ministrator FROM ministrator WHERE id_ministrator = '$id'")) {
				
		$pesquisa = mysql_query("DELETE FROM ministrator WHERE id_ministrator = '$id'");
		
		if(!$pesquisa) {
			header("Location: ministrator.php?status=falied");
		}
		
		header("Location: ministrator.php?status=removido");
		
	} else {
		 
		header("Location: ministrator.php?status=erro");
	}	
?>
